﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace Model
{
    [Serializable]
    public class I11073
    {
		private string _id;
		private string _code;
		private string _nAME;
		private string _bARCODE;
		private string _family;
		private string _po;
		private string _kind;
		private string _brand;
		private string _pri;
		private string _dw;
		private string _dj;
		private string _bUYPRICE;
		private string _aCTIVESELLPRICE;
		private string _qdl;
		private string _tax;
		private string _cbfs;
		
        /// <summary>
        /// 
        /// </summary>
		public string ID
		{
			get { return _id;	 }
			set { _id=value;	}
		}
        /// <summary>
        /// 
        /// </summary>
		public string Code
		{
			get { return _code;	 }
			set { _code=value;	}
		}
        /// <summary>
        /// 
        /// </summary>
		public string NAME
		{
			get { return _nAME;	 }
			set { _nAME=value;	}
		}
        /// <summary>
        /// 
        /// </summary>
		public string BARCODE
		{
			get { return _bARCODE;	 }
			set { _bARCODE=value;	}
		}
        /// <summary>
        /// 
        /// </summary>
		public string Family
		{
			get { return _family;	 }
			set { _family=value;	}
		}
        /// <summary>
        /// 
        /// </summary>
		public string Po
		{
			get { return _po;	 }
			set { _po=value;	}
		}
        /// <summary>
        /// 
        /// </summary>
		public string Kind
		{
			get { return _kind;	 }
			set { _kind=value;	}
		}
        /// <summary>
        /// 
        /// </summary>
		public string Brand
		{
			get { return _brand;	 }
			set { _brand=value;	}
		}
        /// <summary>
        /// 
        /// </summary>
		public string Pri
		{
			get { return _pri;	 }
			set { _pri=value;	}
		}
        /// <summary>
        /// 
        /// </summary>
		public string Dw
		{
			get { return _dw;	 }
			set { _dw=value;	}
		}
        /// <summary>
        /// 
        /// </summary>
		public string Dj
		{
			get { return _dj;	 }
			set { _dj=value;	}
		}
        /// <summary>
        /// 
        /// </summary>
		public string BUYPRICE
		{
			get { return _bUYPRICE;	 }
			set { _bUYPRICE=value;	}
		}
        /// <summary>
        /// 
        /// </summary>
		public string ACTIVESELLPRICE
		{
			get { return _aCTIVESELLPRICE;	 }
			set { _aCTIVESELLPRICE=value;	}
		}
        /// <summary>
        /// 
        /// </summary>
		public string Qdl
		{
			get { return _qdl;	 }
			set { _qdl=value;	}
		}
        /// <summary>
        /// 
        /// </summary>
		public string Tax
		{
			get { return _tax;	 }
			set { _tax=value;	}
		}
        /// <summary>
        /// 
        /// </summary>
		public string Cbfs
		{
			get { return _cbfs;	 }
			set { _cbfs=value;	}
		}
		
		public static List<I11073> GetI11073ListByDataTable(DataTable dt)
		{
			if(dt == null) return null;
		    List<I11073> list = new List<I11073>();
		   
			foreach(DataRow dr in dt.Rows)
            {
				I11073 model = GetI11073ByDataRow(dr);
				if(null == model) continue;
				
				list.Add(model);
            }
           return list;
		}
		
		public static I11073 GetI11073ByDataRow(DataRow dr)
		{
			I11073 model = new I11073(); //实例化I11073
	
			DataColumnCollection dcc = dr.Table.Columns;

			if (dcc.Contains("ID")&&!(dr["ID"] is System.DBNull))  
				model.ID = ( string)dr["ID"];
			if (dcc.Contains("code")&&!(dr["code"] is System.DBNull))  
				model.Code = ( string)dr["code"];
			if (dcc.Contains("NAME")&&!(dr["NAME"] is System.DBNull))  
				model.NAME = ( string)dr["NAME"];
			if (dcc.Contains("BARCODE")&&!(dr["BARCODE"] is System.DBNull))  
				model.BARCODE = ( string)dr["BARCODE"];
			if (dcc.Contains("family")&&!(dr["family"] is System.DBNull))  
				model.Family = ( string)dr["family"];
			if (dcc.Contains("po")&&!(dr["po"] is System.DBNull))  
				model.Po = ( string)dr["po"];
			if (dcc.Contains("kind")&&!(dr["kind"] is System.DBNull))  
				model.Kind = ( string)dr["kind"];
			if (dcc.Contains("brand")&&!(dr["brand"] is System.DBNull))  
				model.Brand = ( string)dr["brand"];
			if (dcc.Contains("pri")&&!(dr["pri"] is System.DBNull))  
				model.Pri = ( string)dr["pri"];
			if (dcc.Contains("dw")&&!(dr["dw"] is System.DBNull))  
				model.Dw = ( string)dr["dw"];
			if (dcc.Contains("dj")&&!(dr["dj"] is System.DBNull))  
				model.Dj = ( string)dr["dj"];
			if (dcc.Contains("BUYPRICE")&&!(dr["BUYPRICE"] is System.DBNull))  
				model.BUYPRICE = ( string)dr["BUYPRICE"];
			if (dcc.Contains("ACTIVESELLPRICE")&&!(dr["ACTIVESELLPRICE"] is System.DBNull))  
				model.ACTIVESELLPRICE = ( string)dr["ACTIVESELLPRICE"];
			if (dcc.Contains("qdl")&&!(dr["qdl"] is System.DBNull))  
				model.Qdl = ( string)dr["qdl"];
			if (dcc.Contains("tax")&&!(dr["tax"] is System.DBNull))  
				model.Tax = ( string)dr["tax"];
			if (dcc.Contains("cbfs")&&!(dr["cbfs"] is System.DBNull))  
				model.Cbfs = ( string)dr["cbfs"];
			
			return model;
		}
    }
}
